package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.MMineMachineMapper;
import com.ruoyi.system.domain.api.MMineMachine;
import com.ruoyi.system.service.IMMineMachineService;

/**
 * 矿机基础信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class MMineMachineServiceImpl implements IMMineMachineService 
{
    @Autowired
    private MMineMachineMapper mMineMachineMapper;

    /**
     * 查询矿机基础信息
     * 
     * @param id 矿机基础信息主键
     * @return 矿机基础信息
     */
    @Override
    public MMineMachine selectMMineMachineById(Long id)
    {
        return mMineMachineMapper.selectMMineMachineById(id);
    }

    /**
     * 查询矿机基础信息列表
     * 
     * @param mMineMachine 矿机基础信息
     * @return 矿机基础信息
     */
    @Override
    public List<MMineMachine> selectMMineMachineList(MMineMachine mMineMachine)
    {
        return mMineMachineMapper.selectMMineMachineList(mMineMachine);
    }

    /**
     * 新增矿机基础信息
     * 
     * @param mMineMachine 矿机基础信息
     * @return 结果
     */
    @Override
    public int insertMMineMachine(MMineMachine mMineMachine)
    {
        mMineMachine.setCreateTime(DateUtils.getNowDate());
        return mMineMachineMapper.insertMMineMachine(mMineMachine);
    }

    /**
     * 修改矿机基础信息
     * 
     * @param mMineMachine 矿机基础信息
     * @return 结果
     */
    @Override
    public int updateMMineMachine(MMineMachine mMineMachine)
    {
        return mMineMachineMapper.updateMMineMachine(mMineMachine);
    }

    /**
     * 批量删除矿机基础信息
     * 
     * @param ids 需要删除的矿机基础信息主键
     * @return 结果
     */
    @Override
    public int deleteMMineMachineByIds(Long[] ids)
    {
        return mMineMachineMapper.deleteMMineMachineByIds(ids);
    }

    /**
     * 删除矿机基础信息信息
     * 
     * @param id 矿机基础信息主键
     * @return 结果
     */
    @Override
    public int deleteMMineMachineById(Long id)
    {
        return mMineMachineMapper.deleteMMineMachineById(id);
    }
}
